<template>
	<view class="winning_info">
		<view class="br2" @click="jumpPage('/pagesMy/allLotteries/index')">
			<p>{{ winInfo.all_task || 0 }}</p>
			<p>全部抽奖</p>
		</view>
		<view class="br2" @click="goMyactiveity">
			<p>{{ winInfo.publish_task || 0 }}</p>
			<p>发起抽奖</p>
		</view>
		<view class="br2">
			<p>{{ winInfo.win_num || 0}}</p>
			<p>中奖记录</p>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				winInfo: {}
			}
		},
		methods: {
			init() {
				uni.$http.get('/user/public/myTaskData').then(res => {
					this.winInfo = res.data.data;
				})
			},
			goMyactiveity() {
				uni.switchTab({
					url: '/pages/myactivity/myactivity' // 跳转的tab页路径
				});
			},
			jumpPage(url) {
				uni.navigateTo({
					url
				})
			}
		},
		created() {
			this.init();
		}
	}
</script>
<style lang="scss" scoped>
	.winning_info {
		display: flex;
		flex-wrap: nowrap;
		height: 100rpx;
		width: 100%;
		justify-content: space-between;
		// border-top: 2rpx solid #C7C7C7;
		padding: 20rpx 0;

		.br2 {
			flex-grow: 1;
			border-right: 1px solid #EEE;
			text-align: center;
			font-size: 26rpx;

			&:last-child {
				border: none;
			}

			p {
				line-height: 50rpx;
			}
		}
	}
</style>